//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<DefaultInputAdaptor.cpp>
///	@path	~/src/appear/xwin/
///	@date	2007/11/06
///	@desc	Default input adapter.

#include "config/config.h"

#include "gui/input/input.h"

#include "appear/xwin/DefaultInputAdaptor.h"

namespace xeres {

	// ctor
	DefaultInputAdaptor::DefaultInputAdaptor( InputHandler * inputHandler )
		: m_inputHandler( inputHandler )
	{
	}

	bool DefaultInputAdaptor::Filter( HWND hWnd , UINT message , WPARAM wParam , LPARAM lParam )
	{
		return DispatchMessage( hWnd , message , wParam , lParam ) == INPUT_HANDLED;
	}
	// OnKeyInput
	HandleInput DefaultInputAdaptor::OnKeyInput( const KeyInput& input )
	{
		return m_inputHandler->OnKeyInput( input );
	}
	// OnMouseInput
	HandleInput DefaultInputAdaptor::OnMouseInput( const MouseInput& input )
	{
		return m_inputHandler->OnMouseInput( input );
	}

} // namespace xeres
